package storage

import (
    "context"
    "time"
)

// VolumeStatus 定义卷状态类型
type VolumeStatus string

const (
    VolumeStatusAvailable VolumeStatus = "available"
    VolumeStatusInUse    VolumeStatus = "in-use"
    VolumeStatusError    VolumeStatus = "error"
)

// StorageAdapter 定义存储适配器接口
type StorageAdapter interface {
    // 基本操作
    Create(ctx context.Context, name string, sizeBytes uint64) error
    Delete(ctx context.Context, name string) error
    Resize(ctx context.Context, name string, newSizeBytes uint64) error
    
    // 获取信息
    GetInfo(ctx context.Context, name string) (*VolumeInfo, error)
    ListVolumes(ctx context.Context) ([]*VolumeInfo, error)
    
    // 快照相关
    CreateSnapshot(ctx context.Context, volumeName, snapName string) error
    DeleteSnapshot(ctx context.Context, volumeName, snapName string) error
    
    // 克隆相关
    CreateClone(ctx context.Context, srcVolume, srcSnapshot, newVolume string) error
}

// VolumeInfo 存储卷信息
type VolumeInfo struct {
    Name       string
    SizeBytes  uint64
    Used       uint64
    Available  uint64
    Status     string
    CreatedAt  string
    UpdatedAt  string
    Metadata   map[string]string
}
